//
//  TYSearchReadyDefaultViewController.m
//  TYUIKit
//
//  Created by TuyaInc on 2019/2/2.
//

#import "TYSearchReadyDefaultViewController.h"
//#import <TYOEMConfig/TYTheme.h>

@interface TYSearchReadyDefaultViewController () <TYSearchReadyControllerProtocol>

@end

@implementation TYSearchReadyDefaultViewController
@synthesize searchController;

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    self.view.backgroundColor = TYTheme.theme.app_bg_color;
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissBackgroundAction)];
    [self.view addGestureRecognizer:tap];
    
    UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(dismissBackgroundAction)];
    swipe.direction = UISwipeGestureRecognizerDirectionDown;
    [self.view addGestureRecognizer:swipe];
    
    self.view.alpha = 0;
}

- (void)dismissBackgroundAction {
    [self.searchController searchBarCancelButtonClicked:self.searchController.searchBar];
}

- (void)viewControllerWillAppearWithAnimation:(BOOL)animate {
    self.view.alpha = 0.8;
}

- (void)viewControllerWillDisappearWithAnimation:(BOOL)animate {
    self.view.alpha = 0;
}

@end
